package Models

import (
	"gorm_study/Table"
	"gorm_study/libs"
	"strconv"
)

func AppendRows() {
	_ = libs.DB.AutoMigrate(&Table.Student{})
	list := []Table.Student{}
	for index, _ := range [10]int{} {
		student := Table.Student{
			Name: "天才 #" + strconv.Itoa(index),
			Age:  10 + index,
		}
		list = append(list, student)
	}

	libs.DB.Create(&list)
}
